import datetime

from django.db import models
from django.contrib.auth.models import User as AUTH_USER


# TODO:站内信
class Message(models.Model):
    id = models.IntegerField(primary_key=True, auto_created=True)
    create_time = models.DateTimeField(default=datetime.datetime.now(), null=False)  # 发送时间
    send_user = models.IntegerField(default=-1, null=False)  # 发送方
    recive_user = models.IntegerField(default=-1, null=False)  # 接收方
    is_read = models.BooleanField(null=False, default=False)  # 是否已读
    content = models.CharField(max_length=1024 * 1024, default="", null=False)  # 内容
    title = models.CharField(max_length=128, default="", null=False)  # 标题


class PVCount(models.Model):
    id = models.IntegerField(primary_key=True, auto_created=True)
    Agent = models.CharField(max_length=1024 * 1024, default="", null=False)  # 请求头
    IPAddress = models.CharField(max_length=1024 * 1024, default="", null=False)  # IP地址
    IPCity = models.CharField(max_length=1024 * 1024, default="", null=False)  # 城市
    CityId = models.CharField(max_length=1024 * 1024, default="", null=False)  # 城市ID
    create_time = models.DateTimeField(null=False, default=datetime.datetime.now())  # 访问时间
